import { Model, DataTypes, Op } from 'sequelize';
import Enumerable from 'linq';
import SequelizeClient from '../sequelizeclient';
let sequelize = SequelizeClient.getInstance();

//科目汇总主表
export class SubjectSummary extends Model {}

const init = () => {
  SubjectSummary.init(
    {
      subjectCode: DataTypes.STRING, //科目code
      earlyStage: DataTypes.DECIMAL, //期初金额
      borrowSummary: DataTypes.DECIMAL, //借方累计金额
      loanSummary: DataTypes.DECIMAL, //贷方累计金额
      summaryData: DataTypes.STRING, // 账期时间  YYYY-DD  如果是空，就是期初
    },
    { sequelize, modelName: 'subjectSummary' },
  );
};

export default { init };
